﻿using Sgr.Workspace.Models;
using Sgr.Workspace.ViewModels;

namespace Sgr.Workspace.Services
{
    /// <summary>
    /// 系统运营情况汇总服务接口
    /// </summary>
    public interface IAppAnalysisService
    {
        /// <summary>
        /// 执行系统运营情况分析任务
        /// </summary>
        /// <param name="cancellationToken">取消令牌</param>
        /// <returns></returns>
        Task AnalysisAsync(CancellationToken cancellationToken = default);

        /// <summary>
        /// 获取运维概况视图模型
        /// </summary>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        Task<OpsOverviewViewModel> GetOpsOverviewAsync(CancellationToken cancellationToken = default);

        /// <summary>
        /// 获取近一周的小时活跃度分布
        /// <param name="cancellationToken">取消令牌</param>
        /// </summary>
        /// <returns>包含24个元素的数组，索引0代表0-1点，索引23代表23-24点的操作总数</returns>
        Task<int[]> GetHourlyActivityDistributionAsync(CancellationToken cancellationToken = default);

        /// <summary>
        /// 获取当前在线用户数（基于有效的刷新令牌）
        /// </summary>
        /// <param name="cancellationToken">取消令牌</param>
        /// <returns></returns>
        Task<CurrentOnlineUserInfo> GetCurrentOnlineUserCountAsync(CancellationToken cancellationToken = default);
    }
}